package com.telit.firecommand.enums;

/**
 * Create by Chencf 2022/09/15
 * 上报枚举类
 */
public enum TransgerReportStatus {

    DOWN(1,"转交"),
    UP(2, "上报");


    private Integer code;
    private String str;

    TransgerReportStatus(int code, String str) {
        this.code = code;
        this.str = str;
    }

    public Integer getCode() {
        return code;
    }

    public String getStr() {
        return str;
    }

    /**
     * 根据code  获取对应的str描述字符串
     */
    public static String code2Str(Integer code) {
        if (code==null)
            return null;
        for (TransgerReportStatus statusNum : TransgerReportStatus.values()) {
            if (statusNum.getCode().equals(code)) {
                return statusNum.getStr();
            }
        }
        return null;
    }

}
